/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Modelos;

import Entidades.Modelo;
import java.util.Collection;
import javax.swing.DefaultComboBoxModel;

/**
 *
 * @author diego
 */
public class ModeloComboModelo extends DefaultComboBoxModel {

    public void addElement(Collection<Modelo> modelo) {
        super.addElement("Seleccione modelo");
        for (Modelo lmodelo : modelo) {
            super.addElement(lmodelo); //To change body of generated methods, choose Tools | Templates.
        }
    }

    @Override
    public Object getSelectedItem() {
        if (super.getSelectedItem() instanceof String) {
            return "Seleccione modelo";
        }
        return (Modelo) super.getSelectedItem(); //To change body of generated methods, choose Tools | Templates.
    }
}
